package main

import (
	"fmt"
	"time"
)

func writeNum(num int, ch, exit chan int) {
	fmt.Println("this is in go func ...")
	ch <- num
	time.Sleep(time.Second * 3)
	exit <- 0
}

func main() {
	ch := make(chan int)
	exit := make(chan int)
	go writeNum(1, ch, exit)
	fmt.Print("this line is after go func .....")
	num := <-ch
	fmt.Print(num)
	<-exit

}
